package articles.controller;

import java.io.IOException;
import java.util.Calendar;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@SuppressWarnings("serial")
public class HotLinkServlet extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		resp.setContentType("text/plain");
		resp.getWriter().println("Hello, world");
		resp.setCharacterEncoding("utf-8");
		Calendar c1 = Calendar.getInstance();
		c1.add(Calendar.DATE,1);
		resp.setHeader( "Cache-Control", "public, max-age=86400");
		resp.setHeader( "Expires", c1.getTime().toGMTString());
		req.setAttribute("title", "Hot link");
		req.setAttribute("description","Hot link.Free articles provided by yooarticles.com - your free articles directory. Find free online articles for your website, eZine or newsletters. Submit your Articles for free syndication and publication.");
		req.setAttribute("keyword", "yooarticles.com,submit free article,article,articles");
		
		try {
			req.getRequestDispatcher("/hot_link.jsp").forward(req, resp);
		} catch (ServletException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
